Working with the Viewer > Integrating with Your Application > Configuring Samples > How to Configure the PHP Sample |
The Prizm Content Connect PHP Sample requires PHP version 5.4 and above.
Copy Code
|
|
---|---|
Alias /pccis_sample /usr/share/prizm/Samples/php <Directory /usr/share/prizm/Samples/php> AllowOverride All </Directory> |
Example |
Copy Code
|
---|---|
apache2ctl configtest |
Example |
Copy Code
|
---|---|
apache2ctl restart |
Example |
Copy Code
|
---|---|
sudo apt-get install php5-curl
|
Example Copy Codesudo apt-get install libapache2-mod-php5
Example |
Copy Code
|
---|---|
sudo setsebool -P httpd_can_network_connect 1 |
By default, the PHP sample is installed to: C:\Prizm\Samples\php, assuming use of the default Prizm Content Connect location of C:\Prizm.
Install IIS, along with the CGI component, and then install and configure PHP. The instructions and installer provided on the IIS site are now old and outdated, as they install PHP version 5.3. Instead, install the latest version of PHP using the Web Platform Installer. If using an already configured server, make sure you are using PHP version 5.4 or higher.
To configure the sample:
Now you can browse to http://localhost/pccis_sample/splash in your browser to see the PHP sample.
Install Apache, or an Apache stack like XAMPP or WAMP server, and a supported version of PHP.
To configure the sample:
Example Copy Code # PCC PHP sample alias Alias /pccis_sample "C:/Prizm/Samples/php" <Directory "C:/Prizm/Samples/php"> Allow from all Require all granted </Directory>
Now you can browse to http://localhost/pccis_sample/splash in your browser to see the PHP sample.
By default, PHP has a small file size upload. If you need to be able to upload larger files through the splash page, you may need to change the following values in the php.ini file of your PHP installation:
Example |
Copy Code
|
---|---|
upload_max_filesize = 1000M post_max_size = 1000M |
This sets the file upload to 1GB, which should be enough to test most files through the splash page. These settings may be too high for a production service, so adjust those accordingly when deploying to production.
From the splash page you have two options:
Full Viewer
If you select Full Viewer on the splash page, then documents will be viewed with the full-featured, out-of-the-box responsive viewer:
Book Reader
If you select Book Reader on the splash page, then documents will be viewed with the book reader. The book reader demonstrates how the PCC viewer can be heavily customized:
This folder contains 6 sub-folders, one folder for each of the four samples (full viewer, book reader, e-signer and e-signer template designer) and two folders for the splash pages (main splash page and the e-sign splash page):
Each of the sample folders are completely self-contained, meaning that they contain all of the files needed to run the sample. Furthermore, with the exception of a few project files and build files, the sample folders contain only the files needed to run the sample.
File / Folder |
Description |
viewer-assets folder |
Contains the essential JavaScript, CSS, fonts, images, language data, and templates (HTML) that make up the viewer. |
viewer-assets/less folder |
Contains less that can be used to build the viewer CSS. This folder is non-essential, and does not need to be re-distributed. |
viewer-assets/Gruntfile.js |
Contains Grunt tasks to build the viewer less. This file is non-essential and does not need to be re-distributed. |
viewer-assets/package.json |
A file used by npm (a package manager). It defines the dependencies installed by npm, which are required to run Grunt and compile the less. |
viewer-webtier folder |
Contains files that implement the php layer of communication between the client-side viewer and the Prizm Application Services. |
viewer-webtier/pas.php |
Handles all requests from the viewer and forwards them to the Prizm Application Services. |
viewer-webtier/pcc.config |
Defines the connection settings for the Prizm Application Services. |
viewer-webtier/PccViewer/Config.php |
This class parses the pcc.config file and provides methods for easily reading its parameters. |
index.php |
The default web starting page in this sample. The HTML5 viewer’s code gets loaded by this page. |
.htaccess |
Contains Apache web server settings. |
predefinedSearch.json |
This data file contains information defining search queries that will appear as selectable items in the full viewer. Note: This file is consumed by the page Default.aspx and the JSON is injected into the HTML that is returned by Default.aspx. Ultimately, the predefined search terms are provided as a JavaScript hash, when the viewer is created. |
redactionReason.json |
This data file contains information defining redaction reasons that are available in the viewer. Note: This file is consumed by the page Default.aspx and the JSON is injected into the HTML that is returned by Default.aspx. Ultimately, the redaction reasons are provided as a JavaScript hash, when the viewer is created. |
File / Folder |
Description |
viewer-assets folder |
Contains the essential JavaScript, CSS, fonts, images, language data, and templates (HTML) that make up the book reader viewer. |
viewer-assets/less folder |
Contains less that can be used to build the viewer CSS. This folder is non-essential, and does not need to be re-distributed. |
viewer-assets/Gruntfile.js |
Contains Grunt tasks to build the viewer less. This file is non-essential and does not need to be re-distributed. |
viewer-assets/package.json |
A file used by npm (a package manager). It defines the dependencies installed by npm, which are required to run Grunt and compile the less. |
viewer-assets/selection.json |
A file used by the IcoMoon application to generate the icons in the book reader viewer. If you need to add an icon to the viewer, you can add the icon to this file and use the IcoMoon application (https://icomoon.io) to generate a new icon font. This file is non-essential and does not need to be re-distributed. |
viewer-webtier folder |
Contains files that implement the php layer of communication between the client-side book reader viewer and the Prizm Application Services. |
viewer-webtier/pas.php |
Handles all requests from the viewer and forwards them to the Prizm Application Services. |
viewer-webtier/pcc.config |
Defines the connection settings for the Prizm Application Services. |
viewer-webtier/PccViewer/Config.php |
This class parses the pcc.config file and provides methods for easily reading its parameters. |
index.html |
The default page for the sample. This page loads the viewer. |
sample-config.js |
Contains references to the assets, web tier, and language files used by the viewer in this sample. |
.htaccess |
Contains Apache web server settings. |
File / Folder |
Description |
viewer-assets folder |
Contains the essential JavaScript, CSS, fonts, images, language data, and templates (HTML) that make up the book reader viewer. |
modules folder |
Contains uncompiled assets of the viewer. These files will be compiled to viewer-assets/js/bundle.js and viewer-assets/css/bundle.css by the build process defined in Gulpfile.js. The files in this folder are non-essential and do not need to be re-distributed. |
Gulpfile.js |
Contains Gulp tasks to build the viewer js and css files. This file is non-essential and does not need to be re-distributed. |
viewer-assets/package.json |
A file used by npm (a package manager). It defines the dependencies installed by npm, which are required to run Gulp and compile the viewer assets.This file is non-essential and does not need to be re-distributed. |
viewer-webtier folder |
Contains files that implement the php layer of communication between the client-side book reader viewer and the Prizm Application Services. |
viewer-webtier/pas.php |
Handles all requests from the viewer and forwards them to the Prizm Application Services. |
viewer-webtier/pcc.config |
Defines the connection settings for the Prizm Application Services. |
viewer-webtier/PccViewer/Config.php |
This class parses the pcc.config file and provides methods for easily reading its parameters. |
index.html |
The default page for the sample. This page loads the viewer. |
.htaccess |
Contains Apache web server settings. |
webpack.config.js |
Webpack configuration file. This file contains all the settings for the webpack module bundler. We use webpack to compile all the files in the modules folder to the bundle.js and bundle.css that are found in the viewer-assets folder. |
File / Folder |
Description |
viewer-assets folder |
Contains the essential JavaScript, CSS, fonts, images, language data, and templates (HTML) that make up the book reader viewer. |
modules folder |
Contains uncompiled assets of the viewer. These files will be compiled to viewer-assets/js/bundle.js and viewer-assets/css/bundle.css by the build process defined in Gulpfile.js. The files in this folder are non-essential and do not need to be re-distributed. |
Gulpfile.js |
Contains Gulp tasks to build the viewer js and css files. This file is non-essential and does not need to be re-distributed. |
viewer-assets/package.json |
A file used by npm (a package manager). It defines the dependencies installed by npm, which are required to run Gulp and compile the viewer assets.This file is non-essential and does not need to be re-distributed. |
viewer-webtier folder |
Contains files that implement the php layer of communication between the client-side book reader viewer and the Prizm Application Services. |
viewer-webtier/pas.php |
Handles all requests from the viewer and forwards them to the Prizm Application Services. |
viewer-webtier/pcc.config |
Defines the connection settings for the Prizm Application Services. |
viewer-webtier/PccViewer/Config.php |
This class parses the pcc.config file and provides methods for easily reading its parameters. |
index.html |
The default page for the sample. This page loads the viewer. |
.htaccess |
Contains Apache web server settings. |
webpack.config.js |
Webpack configuration file. This file contains all the settings for the webpack module bundler. We use webpack to compile all the files in the modules folder to the bundle.js and bundle.css that are found in the viewer-assets folder. |
The file pcc.config is used to configure the connection settings between the web tier and Prizm Application Services. The file can be found at: <sample-folder-name>/viewer-webtier/pcc.config. This file is self-documenting, but a little information about the configuration options is given below.
<DocumentPath> (Only in splash pages) |
The sample pulls named documents from this location. The DocumentPath must have read/write permissions in order for the file drag and drop functionality of the splash page to work. |
<PrizmApplicationServices[Scheme|Host|Port]> |
Specifies how to connect to the Prizm Application Services |